package com.zhonghui.modlules.shop.eshopDomain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eshop.domain.BaseDomain;

@TableName("system_group_data")
public class SystemGroupData extends BaseDomain {
    @TableId
    private Integer id; // 组合数据详情ID
    private String groupName;  // 对应的数据名称
    private String value;  // 数据组对应的数据值（json数据）
    private Integer sort;  // 数据排序
    private Integer status;  // 状态（1：开启；2：关闭；）

    public void copy(SystemGroupData source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public static SystemGroupData.SystemGroupDataBuilder builder() {
        return new SystemGroupData.SystemGroupDataBuilder();
    }

    public Integer getId() {
        return this.id;
    }

    public String getGroupName() {
        return this.groupName;
    }

    public String getValue() {
        return this.value;
    }

    public Integer getSort() {
        return this.sort;
    }

    public Integer getStatus() {
        return this.status;
    }

    public void setId(final Integer id) {
        this.id = id;
    }

    public void setGroupName(final String groupName) {
        this.groupName = groupName;
    }

    public void setValue(final String value) {
        this.value = value;
    }

    public void setSort(final Integer sort) {
        this.sort = sort;
    }

    public void setStatus(final Integer status) {
        this.status = status;
    }

    public SystemGroupData(final Integer id, final String groupName, final String value, final Integer sort, final Integer status) {
        this.id = id;
        this.groupName = groupName;
        this.value = value;
        this.sort = sort;
        this.status = status;
    }

    public SystemGroupData() {
    }

    public static class SystemGroupDataBuilder {
        private Integer id;
        private String groupName;
        private String value;
        private Integer sort;
        private Integer status;

        SystemGroupDataBuilder() {
        }

        public SystemGroupData.SystemGroupDataBuilder id(final Integer id) {
            this.id = id;
            return this;
        }

        public SystemGroupData.SystemGroupDataBuilder groupName(final String groupName) {
            this.groupName = groupName;
            return this;
        }

        public SystemGroupData.SystemGroupDataBuilder value(final String value) {
            this.value = value;
            return this;
        }

        public SystemGroupData.SystemGroupDataBuilder sort(final Integer sort) {
            this.sort = sort;
            return this;
        }

        public SystemGroupData.SystemGroupDataBuilder status(final Integer status) {
            this.status = status;
            return this;
        }

        public SystemGroupData build() {
            return new SystemGroupData(this.id, this.groupName, this.value, this.sort, this.status);
        }

        public String toString() {
            return "SystemGroupData.SystemGroupDataBuilder(id=" + this.id + ", groupName=" + this.groupName + ", value=" + this.value + ", sort=" + this.sort + ", status=" + this.status + ")";
        }
    }
}

